1. Field of the Invention
Embodiments of the present invention generally relate to computer graphics, and more particularly to filtering texture map data.
2. Description of the Related Art
Conventional graphics processors are exemplified by systems and methods developed to read and filter texture map samples. To simplify the texture map filtering performed within a graphics processor, a texture is prefiltered and various resolutions forming an image pyramid or “mipmap” are stored. FIG. 1A is a conceptual diagram of prior art showing the levels of a mipmapped texture including the finest level, Level 101, and successively lower resolution levels, 102, 103, and 104.
The region in texture space corresponding to a pixel is called the pixel's “footprint”. A pixel can be approximated with a circle in screen space. For texture mapping of 2-dimensional textures, the corresponding footprint in texture space can be approximated by an ellipse. In classic use of mipmaps, a mipmap level is chosen so that the footprint when scaled to that level is about 1 texel (texture pixel) in diameter. Then a bilinear filter is used to interpolate between the values of four texels forming a 2×2 square around the footprint center. This is called isotropic filtering, because it filters equally in the two texture space dimensions u and v. Although the filter yielding top image quality—the ideal filter—would have approximately elliptical shape, isotropic filtering approximates the ellipse with a circle, for low hardware cost and speed.
Anisotropic texture filtering attempts higher quality. It uses a filter that more closely matches the elliptical shape of the ideal filter. All ellipses have a largest diameter, which we call the major axis, and a smallest diameter, which we call the minor axis.
Isotropic filtering yields high quality images for pixels whose footprints have major and minor texture axes that are similar in length. But texture stretching, oblique viewing, and perspective can cause footprints to be very elongated. When isotropic filtering is used in such situations, the circle is never a good approximation to the ellipse. If it is too small (diameter close to the minor axis, say), the filter is too sharp, too few texels are averaged, and aliasing results, while if it is too large (diameter close to the major axis, say), the filter is too broad, too many texels are averaged, and blurring results. A Footprint 115 is a pixel footprint in texture space, with a Position 135 being the footprint center. FIG. 1B illustrates a prior art application of texture Level 101 applied to pixels of a Surface 140 that is receding in image space. When viewed in image space, Footprint 115 (an ellipse) appears as circle 116. While isotropic filtering of texture samples within a pixel footprint that forms a circle in texture space results in a high-quality image, isotropic filtering of texture samples within a pixel footprint that forms an ellipse, such as Footprint 115, results in an image with aliasing or blurring artifacts. In contrast to isotropic filtering, anisotropic filtering uses an elliptical or rectangular shaped filter pattern, resulting in fewer aliasing artifacts for footprints with major and minor axes that are not similar in length.
FIG. 1C illustrates Footprint 115 including a Minor Axis 125 that is significantly shorter than a Major Axis 130. Texture samples along Major Axis 130 are read from one or more mipmap levels and are blended to produce a pixel color. The levels the samples are read from is determined using a level of detail (LOD) value which is nominally the log base 2 of the length of Minor Axis 125. Fairly accurate computation of the length of Minor Axis 125 and Major Axis 130 is needed to produce a high quality image. However, an exact computation of the lengths of Major Axis 130 and Minor Axis 125 is expensive in terms of performance and/or die area. However, exactness is not necessary for adequate quality, and may not be practical to implement using a dedicated processing unit within a graphics processor.
Accordingly, there is a need to balance the accuracy used to compute anisotropic texture mapping parameters with image quality to minimize the die area needed to compute the anisotropic texture mapping parameters within a graphics processor.